<template>
  <div>
    <header>
      <span onclick="window.history.go(-1)"><img src="../assets/images/fanhui.png" alt=""></span>

      <p>发票详情</p>
    </header>

    <!-- 查询结果显示 -->
    <div class="con">
      <div class="voiceList">
       
         <p>
          <label>发票代码</label>:
          <span>{{$route.params.invCode}}</span>
        </p>
        <p>
          <label>发票号码</label>:
          <span>{{$route.params.invNumber}}</span>
        </p>
        <p>
          <label>发票日期</label>:
          <span>{{invoices.issueDate}}</span>
        </p>
         <p>
          <label>金额</label>:
          <span>¥ {{invoices.amount}}</span>
        </p>
         <p>
          <label>税额</label>:
          <span>¥ {{invoices.taxAmount}}</span>
        </p>
         <p>
          <label>价税合计</label>:
          <span>¥ {{invoices.sumAmount}}</span>
        </p>

        <p style="border-top:10px solid #eee">购买方信息
        </p>    
        <p>
          <label>名称</label>:
          <span>{{invoices.buyerName}}</span>
        </p>

        <p>纳税人识别号:
          <span>{{invoices.buyerTaxNo}}</span>
        </p>
        <p>
          <label>地址</label>:
          <span>{{invoices.buyerAddress}}</span>
        </p>
    
        <p>
          <label>开户行</label>:
          <span>{{invoices.buyerBank}}</span>
        </p>
        
       
    

      </div>
      <div class="voiceList">
         <p>销售方信息
        </p>
        <p>
          <label>名称</label>:
          <span>{{invoices.sellerName}}</span>
        </p>
        <p>纳税人识别号:
          <span>{{invoices.sellerTaxNo}}</span>
        </p>
        <p>
          <label>地址</label>:
          <span>{{invoices.Address}}</span>
        </p>
        <p>
          <label>开户行</label>:
          <span>{{invoices.sellerBank}}</span>
        </p>
       
       

      </div>

    </div>

  </div>
</template>
<script>
export default {
  name: "inVoiceDetail",
  data() {
    return {
      invoices: {}
    };
  },
  mounted: function() {
    var strJson = {
      voucher: "dZDstbiufOy4DZdDvp5bXqBHswuXUYteo4DqfVJj8eo=",
      invCode: this.$route.params.invCode,
      invNumber: this.$route.params.invNumber
    };
    var str = JSON.stringify(strJson);

    var base64Data = this.Base64.encode(str);

    console.log(base64Data);

    this.axios({
      method: "post",
      url: `${this.siteUrl}/MDMyInvExtraQuery`,
      data: base64Data
    })
      .then(response => {
        this.invoices = response.data;
        console.log(response);
      })
      .catch(function(error) {
        console.log(error);
      });
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
header span {
  position: absolute;
}

header span img {
  height: 20px;
  margin-left: 10px;
  margin-top: 15px;
}

.con {
  background: #eee;
  width: 100%;
  height: 100%;
  overflow: hidden;
  margin-bottom: 50px;
}

.con .voiceList {
  background: #fff;
  margin-top: 10px;
  margin-bottom: 10px;
}

.con .voiceList p {
  line-height: 30px;
  border-bottom: 1px solid #eee;
  padding-left: 15px;
  color: #333;
  font-size: 14px;
  position: relative;
}

.con .voiceList i {
  position: absolute;
  font-style: normal;
  right: 10px;
  font-size: 12px;
  color: #3b9e8c;
}

.con .voiceList span {
  padding-left: 15px;
}

.btn {
  width: 100vw;
  text-align: center;
  margin-top: 50px;
}

.con .voiceList label {
  width: 60px;
  display: inline-block;
  text-align: justify;
  text-align-last: justify;
}
</style>
